package com.sunda.spmsweb.commoncontroller;


import com.sunda.spmscommon.ResponseResult;
import com.sunda.spmscommon.service.ISysLogMqService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * MQ系统日志表 前端控制器
 * </p>
 *
 * @author Wayne
 * @since 2021-05-27
 */
@RestController
@RequestMapping("/sysLogMq")
@Api(tags = "系统日志接口", description = "系统日志接口")
public class SysLogMqController {

    @Autowired
    ISysLogMqService iSysLogMqService;

    @RequestMapping("/getSysLogMq")
    @ApiOperation(value = "获取指定类型MQ日志信息",notes = "日志类型（1发送MQ日志，2接收MQ日志，3发送rest请求，4接收rest请求）", httpMethod = "POST")
    public ResponseResult getSysLogMq(String logType){
        try{
            return ResponseResult.success().add("sysLogMq", iSysLogMqService.getSysLogMq(logType));
        } catch (Exception e){
            e.printStackTrace();
            return ResponseResult.error("请求异常请重试:" + e);
        }
    }
}
